package com.laiketui.admin.store.controller.shop;

import com.laiketui.common.api.banner.BannerService;
import com.laiketui.common.api.shop.ShopService;
import com.laiketui.core.domain.Result;
import com.laiketui.domain.vo.MainVo;
import com.laiketui.domain.vo.banner.BannerVo;
import com.laiketui.domain.vo.shop.ShopVo;
import com.laiketui.root.annotation.HttpApiMethod;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 门店管理
 */
@Api(tags = "后台-商城门店管理")
@RestController
@RequestMapping("/admin/shop/shop")
public class ShopController {

    @Autowired
    private ShopService shopService;

    @ApiOperation("查询门店数据")
    @RequestMapping("/selectInfo")
    @HttpApiMethod(apiKey = "admin.shop.selectInfo")
    public Result selectInfo(ShopVo vo) {
        return Result.success(shopService.selectInfo(vo));
    }

    @ApiOperation("查询门店数据列表")
    @RequestMapping("/selectList")
    @HttpApiMethod(apiKey = "admin.shop.selectList")
    public Result selectList(MainVo vo) {
        return Result.success(shopService.selectList(vo));
    }

    @ApiOperation("新增门店数据")
    @RequestMapping("/insertShop")
    @HttpApiMethod(apiKey = "admin.shop.insertShop")
    public Result insertShop(@Validated ShopVo vo) {
        return Result.success(shopService.insertShop(vo));
    }

    @ApiOperation("修改门店数据")
    @RequestMapping("/updateShop")
    @HttpApiMethod(apiKey = "admin.shop.updateShop")
    public Result updateShop(@Validated ShopVo vo) {
        return Result.success(shopService.updateShop(vo));
    }

    @ApiOperation("删除门店数据")
    @RequestMapping("/deleteShop")
    @HttpApiMethod(apiKey = "admin.shop.deleteShop")
    public Result deleteShop(ShopVo vo) {
        return Result.success(shopService.deleteShop(vo));
    }

    @ApiOperation("门店数据上下架")
    @RequestMapping("/updateStatus")
    @HttpApiMethod(apiKey = "admin.shop.updateStatus")
    public Result updateStatus(ShopVo vo) {
        return Result.success(shopService.updateStatus(vo));
    }

}

